package math2.delaunay;

public class Edge {

	private Point p1;
	private Point p2;

	public Edge(Point p1, Point p2) {
		this.p1 = p1;
		this.p2 = p2;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Edge) {
			Edge e = (Edge) obj;

			return (this.p1 == e.p1 && this.p2 == e.p2)
					|| (this.p1 == e.p2 && this.p2 == e.p1);
		}
		return false;
	}

	public Point getP1() {
		return this.p1;
	}

	public Point getP2() {
		return this.p2;
	}

	@Override
	public int hashCode() {
		return this.p1.hashCode() + this.p2.hashCode();
	}
}
